<?php

 /**
  * @package JooS
  * @subpackage Syntax
  */

  require_once "JooS/Syntax/Complex/Transition.php";

 /**
  * Number ::= Digits , [ ".", Digits ];
  **/
  class JooS_Syntax_Common_Number extends JooS_Syntax_Complex_Transition {
    /**
     *
     * @return JooS_Syntax_Complex_Concatenate
     */
    public function createRule() {
      $parser = $this->getParser();
      
      return $parser->createSyntax("Complex_Concatenate", array(
        $parser->createSyntax("Complex_Repetition", $parser->createSyntax("Simple_Symbol", "-"), 1),
        $parser->createSyntax("Common_Digits"),
        $parser->createSyntax("Complex_Choose", array(
          $parser->createSyntax("Complex_Repetition", $parser->createSyntax("Complex_Concatenate", array(
            $parser->createSyntax("Simple_Symbol", "."),
            $parser->createSyntax("Common_Digits")
          )), 1, 1), 
          $parser->createSyntax("Simple_None")
        ))
      ));
    }
  }
